def get_breadcrumb(category):
    breadcrumb = {
        'cat1': '',
        'cat2': '',
        'cat3': '',
    }
    if category.parent is None:
        #     当前分类没有parent 最顶层的
        # 一级分类
        breadcrumb['cat1'] = category

    elif category.subs.count() == 0:

        #     当前分类没有子分类subs 最底层的
        # 三级分类
        breadcrumb['cat3'] = category
        breadcrumb['cat2'] = category.parent
        breadcrumb['cat1'] = category.parent.parent
    else:
        # 二级分类
        breadcrumb['cat2'] = category
        breadcrumb['cat1'] = category.parent

    return breadcrumb